home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 8
/
Aminet 8 (1995)(GTI - Schatztruhe)[!][Oct 1995].iso
/
Aminet
/
disk
/
cdrom
/
CDR210kit.lha
/
nectools
/
stopaudio.c
< prev
Wrap
C/C++ Source or Header
|
1995-05-11
|
2KB
|
71 lines
/*
NEC-CDR-210 Stop Audio
by dbalster@uni-paderborn.de
*/
#include <exec/exec.h>
#include <dos/dos.h>
#include <devices/scsidisk.h>
#include <proto/exec.h>
#include <proto/dos.h>
#include <string.h>
UBYTE version[] = "$VER: stopaudio 0.9 for the NEC CDR-210 drive";
ULONG sense [5];
UBYTE buffer [10];
UBYTE cmd_stop[] = { 0xDA,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 };
UBYTE cmd_reset[] = { 0xD8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 };
#define TEMPLATE "DEVICE/A,UNIT/N/A"
struct {
STRPTR device;
ULONG unit, pad1, pad2;
} args;
ULONG main (VOID)
{
struct MsgPort *mp;
struct SCSICmd scsi;
struct RDArgs *rdargs;
struct IOStdReq *ior;
if (rdargs = ReadArgs(TEMPLATE,(LONG*)&args,NULL))
{
if(mp=CreateMsgPort())
{
if(ior=(struct IOStdReq*)CreateIORequest(mp,sizeof(struct IOStdReq)))
{
if(!OpenDevice(args.device,*(ULONG*)args.unit,ior,0))
{
ior->io_Command = HD_SCSICMD;
ior->io_Data = (APTR) &scsi;
ior->io_Length = sizeof(struct SCSICmd);
scsi.scsi_Data = (UWORD*) buffer;
scsi.scsi_Length = 0;
scsi.scsi_CmdLength = 10;
scsi.scsi_Flags = SCSIF_AUTOSENSE|SCSIF_WRITE;
scsi.scsi_SenseData = (UBYTE*) sense;
scsi.scsi_SenseLength = 20;
scsi.scsi_Command = cmd_reset;
DoIO(ior);
scsi.scsi_Command = cmd_stop;
DoIO(ior);
CloseDevice((struct IORequest*)ior);
}
DeleteIORequest((struct IORequest*)ior);
}
DeleteMsgPort(mp);
}
FreeArgs(rdargs);
}
else PrintFault(IoErr(),0);
return RETURN_OK;
}